home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
machack
/
Hacks97
/
WarriorsProgress.sit
/
Warrior’s Progress
/
source code
/
Source
/
Libraries
/
Views
/
View.cp
< prev
next >
Wrap
Text File
|
1997-06-28
|
2KB
|
158 lines
// View.cp
#ifndef View_h
#include "View.h"
#endif
#ifndef Pane_h
#include "Pane.h"
#endif
#ifndef RegionObject_h
#include "RegionObject.h"
#endif
#ifndef ViewMap_h
#include "ViewMap.h"
#endif
View::View()
: owner( 0 )
{
}
View::~View()
{
if ( owner != 0 )
owner->ClearView();
}
bool View::Mapped() const
{
return owner != 0 && owner->Mapped();
}
void View::GainMapping()
{
Invalidate();
}
void View::LoseMapping()
{
}
void View::ChangeBounds( Rectangle )
{
Invalidate();
}
void View::Clip( RegionObject& region ) const
{
if ( owner == 0 )
region.BeEmpty();
else
owner->Clip( region );
}
TangibleView *View::Touch( PointObject )
{
return 0;
}
void View::Update() const
{
if ( !Mapped() )
return;
ViewMap map( *this, ViewMap::invalidOnly );
Draw( map );
map.Validate();
}
void View::Update( const Rectangle& restriction ) const
{
if ( !Mapped() )
return;
ViewMap map( *this, ViewMap::invalidOnly );
map.RestrictTo( restriction );
Draw( map );
map.Validate();
}
void View::Update( const RegionObject& restriction ) const
{
if ( !Mapped() )
return;
ViewMap map( *this, ViewMap::invalidOnly );
map.RestrictTo( restriction );
Draw( map );
map.Validate();
}
void View::Redraw() const
{
if ( !Mapped() )
return;
ViewMap map( *this, ViewMap::includeInvalid );
if ( !map.Visible() )
return;
Draw( map );
map.Validate();
}
void View::Redraw( const Rectangle& restriction ) const
{
if ( !Mapped() )
return;
ViewMap map( *this, ViewMap::includeInvalid );
map.RestrictTo( restriction );
if ( !map.Visible() )
return;
Draw( map );
map.Validate();
}
void View::Redraw( const RegionObject& restriction ) const
{
if ( !Mapped() )
return;
ViewMap map( *this, ViewMap::includeInvalid );
map.RestrictTo( restriction );
if ( !map.Visible() )
return;
Draw( map );
map.Validate();
}
void View::Invalidate() const
{
if ( !Mapped() )
return;
ViewMap( *this, ViewMap::includeInvalid ).Invalidate();
}
void View::Invalidate( const Rectangle& restriction ) const
{
if ( !Mapped() )
return;
ViewMap( *this, ViewMap::includeInvalid ).Invalidate( restriction );
}
void View::Invalidate( const RegionObject& restriction ) const
{
if ( !Mapped() )
return;
ViewMap( *this, ViewMap::includeInvalid ).Invalidate( restriction );
}